package com.fusetech.flow.audit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fusetech.flow.audit.domain.AuditProcess;
import com.fusetech.flow.audit.mapper.AuditProcessMapper;
import com.fusetech.flow.audit.service.dto.AuditProcessDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.HashMap;

/**
 * 审计过程服务
 * 审核流程Service
 *
 * @author Liuwq
 * @date 2023/06/13
 */
//@DS("zxhy_platform_db")
@Service
@Transactional
public class AuditProcessService extends ServiceImpl<AuditProcessMapper, AuditProcess> {

	/**
	 * 根据id查询
	 * @param id
	 * @return
	 */
	public AuditProcessDTO findById(String id) {
		return baseMapper.findById ( id );
	}

	/**
	 * 自定义分页检索
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public IPage <AuditProcessDTO> findPage(Page <AuditProcessDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.findList (page, queryWrapper);
	}

	/**
	 * 找到页面zlc
	 *
	 * @param page         页面
	 * @param queryWrapper 查询包装
	 * @return {@link IPage} <{@link HashMap}>
	 */
	public IPage <HashMap> findPageZLC(Page <AuditProcessDTO> page, QueryWrapper queryWrapper){
		return  baseMapper.findListZLC(page, queryWrapper);
	}

}
